package top.minuy.structure.graph.route.hamilton;

import top.minuy.res.graph.GraphRes;
import top.minuy.structure.graph.representations.table.Graph;

/**
 * 测试哈密尔顿回路算法
 *
 * @author Minuy
 * @time 9:32
 * @date 2021/11/23
 */
public class Test {
    public static void main(String[] args) {
        System.out.println("哈密尔顿回路：");
        Graph g1 = new Graph(GraphRes.G_HAMILTON_1);
        HamiltonLoop hl1 = new HamiltonLoop(g1);
        System.out.println(hl1);

        Graph g2 = new Graph(GraphRes.G_HAMILTON_2);
        HamiltonLoop hl2 = new HamiltonLoop(g2);
        System.out.println(hl2);

        Graph g3 = new Graph(GraphRes.G_BRIDGE_2);
        HamiltonLoop hl3 = new HamiltonLoop(g3);
        System.out.println(hl3);

        System.out.println("哈密尔顿路径：");
        Graph g4 = new Graph(GraphRes.G_HAMILTON_3);
        HamiltonPath hp1 = new HamiltonPath(g4, 0, 3);
        HamiltonPath hp2 = new HamiltonPath(g4, 1, 3);
        System.out.println("0->3 : " + hp1);
        System.out.println("1->3 : " + hp2);

    }
}
